package ZoneId_Demo;

public class Test03 {
    public static void main(String[] args) {
        int num = 6;
        String result = toBinaryString(num);
        System.out.println(result);
    }
    public static String toBinaryString(int number){
        StringBuilder sb = new StringBuilder();
        while (true){
            if(number == 0){
                break;
            }
            int remainder = number % 2;
            number /= 2;
            sb.insert(0,remainder);
        }
        return sb.toString();
    }
}
